use serde::{Deserialize, Serialize};

use crate::models::models::components::v2ray::proxy_mode::ComponentV2rayProxyMode;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct ComponentV2rayBasicSetting {
    pub(crate) proxy_mode: ComponentV2rayProxyMode,
    pub(crate) socket_port: u16,
    pub(crate) http_port: u16,
    pub(crate) udp: bool,
    pub(crate) local_area_network: bool,
    #[serde(default)]
    pub(crate) enable_balancer: bool,
}

impl Default for ComponentV2rayBasicSetting {
    fn default() -> Self {
        Self {
            proxy_mode: ComponentV2rayProxyMode::Router,
            socket_port: 1088,
            http_port: 1089,
            udp: false,
            local_area_network: false,
            enable_balancer: false,
        }
    }
}